<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3.6.jQuery常用API-jQuery操作样式-操作CSS方法</title>
    <script src="jquery.min.js"></script>
    <style>
        div {
            width: 200px;
            height: 200px;
            background-color: pink;
        }
    </style>
</head>

<body>
    <div></div>
    <script>
        $(function () {
            // 参数只写属性名，则返回属性值 带单位的字符串
            // console.log($("div").css("width"));
            // $("div").css("width", 300); // "300px"
            $("div").css({
                width: 400,
                height: "400px",
                backgroundColor: "red"
            });
        })
    </script>
</body>

</html>